<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Class 类</title>
</head>
<body>
    <script>
        class Phone{
            get name(){
                console.log('get');
            }
            set name(val){
                console.log(val);
            }
        }

        let p1 = new Phone();
        p1.name;
        p1.name = '123'
    </script>
</body>
</html>